package com.knowledge.plus.other.mapstruct实体类转换.converter;

import com.knowledge.plus.other.mapstruct实体类转换.pojo.PersonDTO;
import com.knowledge.plus.other.mapstruct实体类转换.pojo.PersonDo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * 类转换器
 *
 * @author TPF
 * @since 2024/1/23
 */
@Mapper
public interface PersonConverter {

    PersonConverter INSTANCE = Mappers.getMapper(PersonConverter.class);

    @Mappings(@Mapping(source = "name", target = "userName"))
    PersonDTO personDo2Dto(PersonDo personDo);

}
